<script setup lang='ts'>
import { provide, ref } from 'vue';
import Father from './16_后代组件传值-父组件.vue';
// 谁提供数据 谁负责修改
const salary = ref(10000)// 提供给后代使用
provide("money", salary)
provide("cost", (costMoney: number) => {
    salary.value -= costMoney
})
</script>

<template>
    <h1>我是爷爷</h1>
    <p>爷爷的退休金：{{ salary }}</p>
    <Father></Father>
</template>

<style scoped></style>